<template>
	<view class="requisition-container">
		<requistionInfoList :requistionInfoList="requistionInfoList"></requistionInfoList>
	</view>
</template>

<script>
	import {
		warehouseOutQueryListMap
	} from "../../../../../api/homepage.js"
	import requistionInfoList from './InfoList/index.vue'
	export default {
		components: {
			requistionInfoList
		},
		data() {
			return {
				requistionInfoList: []
			}
		},
		onPullDownRefresh() {
			setTimeout(function() {
				uni.redirectTo({
					url: "/pages/HomePage/WarehouseManage/StorageManagement/AccessoryManagement/Requisition/index"
				})
				uni.stopPullDownRefresh();
			}, 1000);
		},
		created() {
			this.getWarehouseOutQueryListMap()
		},
		methods: {
			getWarehouseOutQueryListMap() {
				warehouseOutQueryListMap({
					checkStatus: 0,
				}).then((res) => {
					if (res.code == 0) {
						for (var i = 0; i < res.data.length; i++) {
							let requistionInfoGood = {
								id: res.data[i].id,
								billNo: res.data[i].billNo, //单据编号
								applyDeptName: res.data[i].applyDeptName, //申请部门
								billUserName: res.data[i].billUserName, //申请人
								billDate: res.data[i].billDate, //申请日期
							}
							this.requistionInfoList.push(requistionInfoGood)
						}
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration: 3000,
						})
					}
				})
			},
		}
	};
</script>

<style lang="scss">
	page {
		background-color: #F6F7FB;
	}

	.requisition-container {
		margin: 5px 0;
	}
</style>
